07 |
您所在的位置:网站首页 › vcs 保存波形 › 07 |
逻辑仿真工具-VCS
在verilog中代码,嵌入$vcdpluson()函数dump波形
不带参数,将所在的module波形以及包含的子模块的波形都保存 5.编译选项
![]() ![]() ![]() Makefile文件 # 产生的二进制可执行文件 OUTPUT = simv_fsm_moore # 进行宏定义,用于条件编译 ALL_DEFINE = +define+DUMP_VPD # vpd file name VPD_NAME = +vpdfile+${OUTPUT}.vpd # compile command VCS = vcs -sverilog +v2k -timescale = 1ns/1ns -debug_all +vcs+flush+all ${ALL_DEFINE} ${VPD_NAME} -o ${OUTPUT} -l compile.log # simulation command SIM = ./${OUTPUT} ${VPD_NAME} -l ${OUTPUT}.log # start compile com: ${VCS} -f file_list.f # start simulation sim: ${SIM} #start clean rm -rf ./csrc *.daidir ./csrc *.log *.vpd *.vdb simv* *.key *race.out*file_list.f -timescale = 1ns/1ns // Macro define // +define+INC_COUNTER // Source file ./rtl/fsm_moore.v //testbench ./tb/fsm_top.v ./tb/hello.c make clean -- 删除当前目录下产生的仿真文件 make com -- 执行编译 dve & -- 打开图形化界面-->file-->找到xx.vpd文件 dve -vpd xxx.vpd & -- 打开图形化界面,并且将波形文件加载进去 // verilog initial begin `ifdef DUMP_ME $vcdpluson(); // 不加参数,dump所有波形 $vcdpluson(1,fsm_top); //只记录top层的波形 `endif end VCS默认是不会记录数组波形的 使用$vcdplusmemon(); dump数组的波形 dump数组的波形 // 在top层中定义了mem reg [7:0] mem[0:15] // 使用$readmemh()函数进行初始化 initial begin $readmemh('./data/src.txt',mem); // 将src.txt文件内容加载到mem中 for(i = 0;i |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |